package com.kstudio.ksnapshot.kimageedit;

import android.app.Activity;
import android.content.Intent;
import android.graphics.Bitmap;
import android.graphics.BitmapFactory;
import android.os.Bundle;

import com.kstudio.ksnapshot.KUtil;
import com.kstudio.ksnapshot.R;
import com.kstudio.ksnapshot.view.KImageView;

public class KImageEditActivity extends Activity {
    KUtil log = new KUtil("KImageEditActivity");

    KImageView kImageView;
    String kPath;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        log.i("***************** onCreate *****************");
        super.onCreate(savedInstanceState);

        setContentView(R.layout.kimage_edit_activity);

        Intent intent = getIntent();
        if(intent != null) {
            kPath = intent.getStringExtra("path");
        } else {
            log.e("Error");
        }

        Bitmap bitmap = BitmapFactory.decodeFile(kPath);
        if(bitmap == null) {
            log.e("Error");
        }

        kImageView = (KImageView) findViewById(R.id.kimageview);
        kImageView.setImageBitmap(bitmap);
    }

    @Override
    protected void onRestart() {
        log.i("***************** onRestart *****************");
        super.onRestart();
    }

    @Override
    protected void onStart() {
        log.i("***************** onStart *****************");
        super.onStart();
    }

    @Override
    protected void onResume() {
        log.i("***************** onResume *****************");
        super.onResume();
    }

    @Override
    protected void onPause() {
        log.i("***************** onPause *****************");
        super.onPause();
    }

    @Override
    protected void onStop() {
        log.i("***************** onStop *****************");
        super.onStop();
    }

    @Override
    protected void onDestroy() {
        log.i("***************** onDestroy *****************");
        super.onDestroy();
    }
}
